// 平台属性管理
import { service2 } from '@/utils/request'

// /admin/product/getCategory1  一级分类接口 get请求
export const reqCategoryList = () => service2.get('/admin/product/getCategory1')

// /admin/product/getCategory2/{category1Id}  二级分类接口 get请求
export const reqCategory2List = (data) => service2.get(`/admin/product/getCategory2/${data.category1Id}`)

// /admin/product/getCategory3/{category2Id} 三级分类接口  get请求
export const reqCategory3List = (data) => service2.get(`/admin/product/getCategory3/${data.category2Id}`)

// /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}  商品的属性  get请求
export const reqAttrList = (data) => service2.get(`/admin/product/attrInfoList/${data.category1Id}/${data.category2Id}/${data.category3Id}`)

// /admin/product/saveAttrInfo    添加商品属性      post请求  携带参数：属性名(attrName),属性值(valueName),三级分类的id(category3Id)
export const reqAddAttrOrUpdateAttr = data => service2.post('/admin/product/saveAttrInfo', data)

// /admin/product/deleteAttr/{attrId}  删除商品属性  delete请求  携带参数：商品id
export const reqDelete = data => service2.delete(`/admin/product/deleteAttr/${data.attrId}`)

